type TupleToNestedObject<T extends Array<unknown>, U> = T extends [
  infer F,
  ...infer R
]
  ? {
      [P in F as F extends PropertyKey ? F : never]: TupleToNestedObject<R, U>;
    }
  : U;

type Yu11 = TupleToNestedObject<["a", "b", "c"], string>;
